package com.mate.cloud.enums;


import com.mate.cloud.common.ErrorMessage;
import com.mate.cloud.common.config.PropertyConfig;
import com.mate.cloud.common.constant.ResponseEnum;


/**
 * 消息异常码定义
 *
 * @author: MI
 * @email: 448341911@qq.com
 * @createTime: 2024/5/22 9:21
 * @updateUser: MI
 * @updateTime: 2024/5/22 9:21
 * @updateRemark: 修改内容
 * @version: v4.2.1
 */
public enum IMMessageExceptionEnum implements ResponseEnum {
    /**
     * IM 消息请求异常
     */
    IM_REQUEST_ERROR(100001);

    private Integer code;

    IMMessageExceptionEnum(Integer code) {
        this.code = code;
    }

    @Override
    public Integer getCode() {
        return code;
    }
    /**
     * 这里会从Spring中容器去取到配置
     *
     * @return
     */
    /**
     * 这里会从Spring中容器去取到配置
     *
     * @return
     */

    @Override
    public String getLocalMessage() {
        String message = PropertyConfig.getProperty(this.code);
        return message == null ? "" : message;
    }

    @Override
    public String getLocalMessage(Object[] args) {
        String message = PropertyConfig.getProperty(this.getCode());
        return message == null ? "" : message;
    }

}